//患者Model
import 'package:oral_cloud/model/medical_imaging.dart';

class Patient {
  int id;
  String patientNo;
  String username;
  String birthDate;
  String recordDate;
  int sex;
  String mobile;
  String address;
  int ctNum;//CT数量
  int partCtNum;//局部CT数量
  int panoramicNum;//全景数量
  int lateralNum;//侧位数量
  int tmjNum;//TMJ数量


  String avatar;

  List<MedicalImaging> imagings;


  Patient.fromJsonMap(Map<String, dynamic> map):
        id = map["id"],
        patientNo = map["patientNo"],
        username = map["patientName"],
        birthDate = map["birthDate"],
        recordDate = map["recordDate"],
        sex = map["sex"],
        mobile = map["mobile"],
        address = map["address"],
        ctNum = map["ctNum"],
        partCtNum = map["partCtNum"],
        panoramicNum = map["panoramicNum"],
        lateralNum = map["lateralNum"],
        tmjNum = map["tmjNum"],
        avatar = map["avatar"];


  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = id;
    data['patientNo'] = patientNo;
    data['patientName'] = username;
    data['birthDate'] = birthDate;
    data['recordDate'] = recordDate;
    data['sex'] = sex;
    data['mobile'] = mobile;
    data['address'] = address;
    data['avatar'] = avatar;
    data['ctNum'] = ctNum;
    data['partCtNum'] = partCtNum;
    data['panoramicNum'] = panoramicNum;
    data['lateralNum'] = lateralNum;
    data['tmjNum'] = tmjNum;
    return data;
  }

  @override
  String toString() {
    return 'Patient{id: $id, patientNo: $patientNo, username: $username, birthDate: $birthDate, recordDate: $recordDate, sex: $sex, mobile: $mobile, address: $address, ctNum: $ctNum, partCtNum: $partCtNum, panoramicNum: $panoramicNum, lateralNum: $lateralNum, tmjNum: $tmjNum, avatar: $avatar, imagings: $imagings}';
  }
}